1. Field of the Invention
The present invention relates to a method of recovering texture data in video streams, and more specifically, to a method of recovering texture data for error blocks in video streams using spatial interpolation.
2. Description of the Prior Art
Video streams are composed of many macro blocks. It is inevitable that some of the blocks in a video stream may have errors when transmitting. The macro blocks containing errors are referred to as error blocks. Methods have been developed for reconstructing error blocks in order to clean up the video signal. The blocks surrounding the error block are analyzed, and the error block is reconstructed to be similar to the surrounding blocks. Each block contains a plurality of pixels. For the following disclosure, it will be assumed that each block is a set of 16×16 pixels.
Please refer to FIG. 1. FIG. 1 is a diagram of a video frame 5 containing an error block 10. The error block 10 is shown in the video frame 5, surrounded by other blocks 12. The prior art method of reconstructing the error block 10 contains several steps. First of all, the method calculates a gradient for each pixel in the surrounding blocks 12. Thereafter, the texture edge is detected by comparing the pixel gradients to a threshold level. The gradient directions of the pixels in the surrounding blocks 12 fall into eight classes, which are illustrated in FIG. 2. Eight surrounding pixels 20 in FIG. 2, which are labeled 0 to 7, present eight different directions extending from a central pixel 15. Each of these eight directions covers an angle area of 22.5 degrees. For each of the pixels in surrounding blocks, the texture edge extending direction of one pixel can be calculated using its gradient direction. If the texture edge extending direction runs through the error block 10, a counter corresponding to that direction will be accumulated with the gradient magnitude of the pixel. Once the texture edge extension has been calculated for each of the pixels in the four surrounding blocks, the counter totals are used in calculating filtering weights. The error block 10 is then reconstructed by weight filtering its surrounding boundary pixels from blocks 12. The filtering weights correspond to the eight edge extending directions and further to the eight pixels shown in FIG. 2. To perform the weight filtering, the texture data of the surrounding pixels of the error pixel will be multiplied with corresponding weights and then averaged for the reconstructed result. The weight filtering is performed for each pixel of the error block 10 to reconstruct the whole error block finally.
Unfortunately, the calculating the texture edge extension for each of the 8 sections is complicated and requires heavy computation.